<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>到货验收--设备加电检验form</title>

    <!--公用样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/comment.css"/>
    <!--页面样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/style.css"/>
    <!--Layui-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--extended-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/extended.css"/>
    <!--公用样式JS-->
    <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/jquery.boot.js"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
    <script type="text/javascript" src="${re.contextPath}/pageoffice.js" id="po_js_main"></script>
</head>
<style>
    .windows {
        background-color: #f8f8f8;
    }

    .popUp {
        width: 90%;
    }


</style>

<body>
<div class="windows">

    <div class="popUp whitebg">
        <div class="popUpTitle ft24 bold">设备加电检验记录表</div>
        <div class="clearfix mt10">
            <span class="fl">SDZZ-QR026</span>
            <span class="fr">JDJC<input id="orderCode" name="orderCode" code="${orderCode}" value="${orderCode}"></span>
        </div>
        <div class="popUpBox book">
            <form action="" class="layui-form addform">
                <div class="popUpBox acceptance">
                    <table>
                        <tr>
                            <td style="border: 1px solid #CCCCCC;width: 20%;">工程名称</td>
                            <td style="border: 1px solid #CCCCCC;width: 40%;">
                                <input type="hidden" name="spfPrjid" value="${spf_prjid}">
                                <input type="hidden" name="fileInd" value="${ind}">
                                <input type="hidden" name="spfStaid" value="${spf_staid}">
                                <input type="hidden" name="spfMilid" value="${spf_milid}">
                                <input type="hidden" name="projectName" value="${pdto.projectName}">
                                <input type="hidden" name="spfFilecode" value="${spfFilecode}">
                                <input type="hidden" name="bfcId" value="29">
                                <input type="hidden" name="orderCode" value="${orderCode}">
                                <input type="hidden" name="fbCode" value="${fbCode}">
                                <input type="hidden" name="pcId" value="${pcId}">
                                <input type="hidden" name="fileParentId" value="${fileId}">
                                <input type="text" name="spfF1" id="spfF1" value="${pdto.projectName}"
                                       lay-verify="spfF1" style="width: 100%;">
                            </td>
                            <td style="border: 1px solid #CCCCCC;width: 10%;text-align: center;">地点</td>
                            <td colspan="2" style="border: 1px solid #CCCCCC;width: 30%; text-align: center;">
                                <input type="text" name="spfF2" id="spfF2" lay-verify="spfF2">
                            </td>
                        </tr>
                        <tr>
                            <td style="border: 1px solid #CCCCCC;width: 20%;">设备名称</td>
                            <td style="border: 1px solid #CCCCCC;width: 40%;">
                                <select name="spfF3" lay-ignore id="seldevname">
                                    <option value="">请选择设备</option>
                                    <#list devlist as v>
                                        <option no="${v[0]}" value="${v[2]}">${v[2]}</option>
                                    </#list>
                                </select>
                            </td>
                            <td style="border: 1px solid #CCCCCC;width: 10%;text-align: center">检查日期</td>
                            <td colspan="2" style="border: 1px solid #CCCCCC;width: 30%;">
                                <input type="text" name="spfF4" id="spfF4" placeholder="检查日期" lay-verify="spfF4">
                            </td>
                        </tr>
                        <tr>
                            <td>序列号</td>
                            <td colspan="4">
                                <input type="text" name="spfF5" lay-verify="spfF5">
                            </td>
                        </tr>

                        <tr>
                            <table>
                                <tr>
                                    <td style="width: 10%; border: 1px solid #CCCCCC;text-align: center">序号</td>
                                    <td style="width: 20%; border: 1px solid #CCCCCC;text-align: center">步骤</td>
                                    <td style="width: 20%; border: 1px solid #CCCCCC;text-align: center">检验合格应出现的预期结果
                                    </td>
                                    <td style="width: 20%;border: 1px solid #CCCCCC;text-align: center">实际检验时候相符</td>
                                    <td style="width: 20%;border: 1px solid #CCCCCC;text-align: center">异常情况（频次）</td>
                                    <td style="width: 10%;border: 1px solid #CCCCCC;text-align: center"></td>
                                </tr>
                                <tr>
                                    <td style="width: 10%; border: 1px solid #CCCCCC;text-align: center">1</td>
                                    <td style="width: 20%; border: 1px solid #CCCCCC;text-align: center">系统加电</td>
                                    <td style="width: 20%; border: 1px solid #CCCCCC;text-align: center">能够正常加电,开机关机正常
                                    </td>
                                    <td style="width: 20%;border: 1px solid #CCCCCC;text-align: center">
                                        <select name="spfF6" lay-ignore>
                                            <option selected="true">是</option>
                                            <option>否</option>
                                        </select>
                                    </td>
                                    <td style="width: 20%;border: 1px solid #CCCCCC;">
                                        <input type="text" name="spfF7">
                                    </td>
                                    <td style="width: 10%;border: 1px solid #CCCCCC;"></td>
                                </tr>
                                <tr>
                                    <td style="width: 10%; border: 1px solid #CCCCCC;text-align: center">2</td>
                                    <td style="width: 20%; border: 1px solid #CCCCCC;text-align: center">系统自检</td>
                                    <td style="width: 20%; border: 1px solid #CCCCCC;text-align: center">自检无报错</td>
                                    <td style="width: 20%;border: 1px solid #CCCCCC;text-align: center">
                                        <select name="spfF8" lay-ignore>
                                            <option selected="true">是</option>
                                            <option>否</option>
                                        </select>
                                    </td>
                                    <td style="width: 20%;border: 1px solid #CCCCCC;">
                                        <input type="text" name="spfF9">
                                    </td>
                                    <td style="width: 10%;border: 1px solid #CCCCCC;"></td>
                                </tr>

                            </table>
                        </tr>
                        <tr>
                            <td colspan="5">从操作系统检测的主要硬件规格的指标</td>
                        </tr>
                        <tr>
                            <table id="tabledata">
                                <tr>
                                    <td style="width: 10%; border: 1px solid #CCCCCC;">
                                        <input align="center" class="fdata" type="text" value="3"
                                               name="formDataList[0].data1" iname="data1" style="text-align: center">
                                        <input type="hidden" class="fdata" name="formDataList[0].tableRow"
                                               iname="tableRow" value="8">
                                        <input type="hidden" class="fdata" name="formDataList[0].tableCos"
                                               iname="tableCos" value="5">
                                        <input type="hidden" class="fdata" name="formDataList[0].tableIndex"
                                               iname="tableIndex" value="1">
                                    </td>
                                    <td style="width: 20%; border: 1px solid #CCCCCC;"><input type="text" class="fdata"
                                                                                              name="formDataList[0].data2"
                                                                                              iname="data2"
                                                                                              style="text-align: center">
                                    </td>
                                    <td style="width: 20%; border: 1px solid #CCCCCC;"><input type="text" class="fdata"
                                                                                              name="formDataList[0].data3"
                                                                                              iname="data3"
                                                                                              style="text-align: center">
                                    </td>
                                    <td style="width: 20%;border: 1px solid #CCCCCC;text-align: center">
                                        <select lay-ignore class="fdata" name="formDataList[0].data4" iname="data4">
                                            <option selected="true">是</option>
                                            <option>否</option>
                                        </select>
                                    </td>
                                    <td style="width: 20%;border: 1px solid #CCCCCC;">
                                        <input type="text" class="fdata" name="formDataList[0].data5" iname="data5"
                                               style="text-align: center">
                                    </td>
                                    <td style="width: 10%;border: 1px solid #CCCCCC;" align="center">
                                        <img src="${re.contextPath}/plugin/common/images/19@2x.png" style="width: 22px;"
                                             onclick="deleteStr(this)" alt="">
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 10%; border: 1px solid #CCCCCC;">
                                        <input align="center" class="fdata" type="text" value="4"
                                               name="formDataList[1].data1" iname="data1" style="text-align: center">
                                        <input type="hidden" class="fdata" name="formDataList[1].tableRow"
                                               iname="tableRow" value="8">
                                        <input type="hidden" class="fdata" name="formDataList[1].tableCos"
                                               iname="tableCos" value="5">
                                        <input type="hidden" class="fdata" name="formDataList[1].tableIndex"
                                               iname="tableIndex" value="1">
                                    </td>
                                    <td style="width: 20%; border: 1px solid #CCCCCC;"><input class="fdata" type="text"
                                                                                              name="formDataList[1].data2"
                                                                                              iname="data2"
                                                                                              style="text-align: center">
                                    </td>
                                    <td style="width: 20%; border: 1px solid #CCCCCC;"><input class="fdata" type="text"
                                                                                              name="formDataList[1].data3"
                                                                                              iname="data3"
                                                                                              style="text-align: center">
                                    </td>
                                    <td style="width: 20%;border: 1px solid #CCCCCC;text-align: center">
                                        <select lay-ignore class="fdata" name="formDataList[1].data4" iname="data4">
                                            <option selected="true">是</option>
                                            <option>否</option>
                                        </select>
                                    </td>
                                    <td style="width: 20%;border: 1px solid #CCCCCC;">
                                        <input type="text" class="fdata" name="formDataList[1].data5" iname="data5"
                                               style="text-align: center">
                                    </td>
                                    <td style="width: 10%;border: 1px solid #CCCCCC;" align="center">
                                        <img src="${re.contextPath}/plugin/common/images/19@2x.png" style="width:22px;"
                                             onclick="deleteStr(this)" alt="">
                                    </td>
                                </tr>
                            </table>
                        </tr>

                    </table>
                    <table style="border: none;">
                        <tr style="border: none;">
                            <td style="border: none;width: 90%;" colspan="3"></td>
                            <td style="border: none;width: 10%;">
                                <img src="${re.contextPath}/plugin/common/images/57@2x.png" alt=""
                                     onclick="addStr(this)" style="width: 21px;padding-left: 39px;padding-top: 10px;">
                            </td>
                        </tr>

                    </table>

                </div>
                <div class="popUpBtn center">
                    <button type="button" class="blue bgnone close">关闭</button>
                    <button type="button" class="bluebg white" lay-submit lay-filter="submit">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    var layer;
    var form;
    var laydate;
    var upload;
    var uploadListIns;
    layui.use(['form', 'laydate', 'layer', 'upload'], function () {
        layer = layui.layer;
        form = layui.form;
        laydate = layui.laydate;
        upload = layui.upload;
        // 日期
        laydate.render({
            elem: '#spfF4',
            value: new Date(),
            trigger: 'click',
            format: 'yyyy年MM月dd日'
        });
        uploadListIns = upload.render({
            elem: '.uploadimg',
            url: '/supervisor/projectManager/addFile2222222', //改成您自己的上传接口
            accept: 'file',
            data: null,
            multiple: true,
            auto: false,
            choose: function (obj) {
                var files = obj.pushFile();
                obj.preview(function (index, file, result) {
                    $('#lcimage').attr('src', result); //图片链接（base64）
                });
            },
            before: function () {
            },
            done: function (res, index, upload) {
            },
            error: function (index, upload) {
                layer.msg("上传失败！");
            }
        });
        // 表单校验
        //$('form').initVerify(form);
        //监听提交
        form.on('submit(submit)', function (data) {
            console.log(data.field);
            layerAjax('/supervisor/projectManager/addFormFile', data.field, '', function (d) {
                if (d.flag == true) {
                    var spfId = d.data.spfId;// fmid
                    var fpid = d.data.fpid;// fpid
                    POBrowser.openWindowModeless('/sys/office/openword?ft=2&fmid=' + spfId + '&fpid=' + fpid, 'width=1200px;height=800px;', '{}')
                } else {
                    layer.msg(d.msg, {icon: 2});
                }
            });
            return false;
        });
        $('.close').click(function () {
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        });
        $("#seldevname").change(function () {
            var _b = $(this).find("option:selected").attr("no");
            if (_b) {
                _b = "-" + _b;
            } else {
                _b = "";
            }
            $("input[name=orderCode]").val($("#orderCode").attr("code") + _b);
        });
        form.render();
    });

    // 删除
    function deleteStr(object) {
        $(object).parent().parent().remove();
        reNameList();
    }

    function addStr(object) {
        var _tb = $("#tabledata").find("tbody");
        var _tr = _tb.find("tr:last").clone();
        var _tr_cnt = _tb.find("tr").length + 3;
        _tr.find("td:eq(0) input[type=text]").val(_tr_cnt);
        _tb.append(_tr);
        reNameList();
    }

    function reNameList() {
        $("#tabledata").find("tbody").find("tr").each(function (i, v) {
            var _v_tr = $(v);
            _v_tr.find(".fdata").each(function (j, w) {
                var _v_input = $(w);
                _v_input.attr("name", "formDataList[" + i + "]." + _v_input.attr("iname"));
            })
        })
    }
</script>


<!-- 底部结束 -->
</body>
</html>
